<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});



Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/employee', 'HomeController@employee')->name('employee');
Route::post('/employee/add_employee', 'HomeController@add_employee')->name('employee.add_employee');

Route::post('/employee/update_employee/{id}', 'HomeController@update_employee')->name('employee.update_employee');
Route::post('/employee/update_employees/{id}', 'HomeController@update_employees')->name('employee.update_employees');
Route::delete('/employees/{id}', 'HomeController@employeeDestroy')->name('employees.destroy');

Route::get('/customer', 'HomeController@customer')->name('customer');

//账号管理的资源路由
Route::get('/users/permission/{id}', 'UsersController@permissionCreate')->name('users.permission');
Route::post('/users/permission/{id}', 'UsersController@permissionStore')->name('users.permission');
Route::resource('users', 'UsersController');

//借贷管理的资源路由
Route::post('/loans/upload', 'LoansController@upload')->name('loans.upload');
Route::post('/loans/remove_file/{id}', 'LoansController@removeFile')->name('loans.remove_file');
Route::resource('loans', 'LoansController');

//财务
Route::resource('finance', 'FinanceController');
Route::post('/finance/state/{type}/{id}', 'FinanceController@state')->name('finance.state');


//ajax
Route::post('/employee/check_name', 'HomeController@check_name')->name('employee.check_name');
Route::post('/employee/check_tel', 'HomeController@check_tel')->name('employee.check_tel');

//审核
Route::get('examine/{type}/handle/{id}', 'ExamineController@handle')->name('examine.handle');

Route::resource('examine', 'ExamineController');

// 权限
Route::resource('permissions', 'PermissionsController');
